//
//  DYDaifukuanBottom.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/2/4.
//  Copyright © 2021 叁拾叁. All rights reserved.
//


import UIKit
import YYText

class DYDaifukuanBottom: SYBaseView {
    
    let alert = RYPaySuccessAlert()
    
    var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = .white
        v.layer.shadowColor = UIColor(hex: 0xB3B3B3).cgColor
        v.layer.shadowOpacity = 0.5//阴影透明度
        v.layer.shadowOffset = CGSize(width: 0, height: -5)///阴影偏移量,四周
        v.layer.shadowRadius = 5//阴影半径  shadowPathWidth：阴影宽度
        return v
    }()
    
    var delete: UIButton = {
        let v = UIButton()
        v.setTitle("删除订单", for: .normal)
        v.setTitleColor(UIColor(hex: 0x666666), for: .normal)
        v.titleLabel?.font = 15.autoFontSize()
        v.layer.cornerRadius = 18.autoWidth()
        v.layer.borderWidth = 1
        v.layer.borderColor = UIColor(hex: 0x666666)?.cgColor
        return v
    }()
   

    let tijiao: UIButton = {
        let v: UIButton  = UIButton(frame: CGRect(x: 0, y: 0, width: 145.autoWidth(), height: 44.autoWidth()))
        v.vg_gradLayerCreat(leftC: UIColor(hex: 0xFF7F00), rightC: UIColor(hex: 0xFF9700))
        v.setTitle("继续支付", for: .normal)
        v.setTitleColor(UIColor.white, for: .normal)
        v.titleLabel?.font = 18.autoFontSize()
        v.layer.cornerRadius = 5
        v.layer.masksToBounds = true
        return v
    }()
    
    func configure(_ priceStr: String) {
        
    }
    
    override func initViews() {
        
        
        tijiao.addAction {[weak self] in
            if let `self` = self {
                let vc = DYJingquDaihexiaoVC(id:614)
                self.currentVC.sy_push(vc)
            }
        }
        
        addSubview(bgView)
        
        addSubview(delete)
        addSubview(tijiao)
        bgView.snp.makeConstraints { (make) in
            make.top.left.right.bottom.equalToSuperview()
        }
        delete.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-170.autoWidth())
            make.height.equalTo(36.autoWidth())
            make.width.equalTo(79.autoWidth())
        }
        tijiao.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-10.autoWidth())
            make.height.equalTo(44.autoWidth())
            make.width.equalTo(145.autoWidth())
        }
    }

    func setAlert() {
        
        let window = UIApplication.shared.keyWindow
        window?.addSubview(alert)
        alert.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
    }
}
